<div id="sub_nav">
    <nav class="navbar navbar-default" role="navigation">
        <div class="container" style="width:1180px;">
            <a href="{:U($MODULE_INFO['entry'])}" class="navbar-brand logo" ><i class="icon-{$brand.icon}"></i> {$menu_list.first.title}</a>
            <div class="container-fluid">
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-7">
                    <ul class="nav navbar-nav">
                        <volist name="menu_list.left" id="menu">
                            <if condition="$menu['children']">
                                <!--二级菜单-->
                                <li id="tab_{$menu.tab}" class="dropdown {$class}">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                        <neq name="menu.icon" value=""><i class="icon-{$menu.icon}"></i>
                                        </neq>
                                        {$menu.title} <i class="icon-caret-down"></i>
                                    <ul class="dropdown-menu" role="menu">
                                        <volist name="menu.children" id="child">
                                            <li><a href="{$child.href}" class="{$child.class}">
                                                <neq name="child.icon" value=""><i
                                                        class="glyphicon glyphicon-{$child.icon}"></i></neq>
                                                {$child.title}</a></li>
                                        </volist>

                                    </ul>
                                </li>
                                <else/>
                                <!--一级菜单-->
                                <li id="tab_{$menu.tab}"  class="{$menu.li_class}"
                                        ><a href="{$menu.href}" class="{$menu.a_class}">
                                    <neq name="menu.icon" value=""><i class="glyphicon glyphicon-{$menu.icon}"></i>
                                    </neq>
                                    {$menu.title}</a></li>
                            </if>

                        </volist>
                    </ul>
                    <if condition="$menu_list['right'] neq null">
                        <ul class="nav navbar-nav navbar-right">
                            <volist name="menu_list.right" id="menu">
                                <php>$class=($current==$menu['tab']?'active':'');</php>
                                <switch name="menu.type">
                                    <case value="button">
                                        <a href="{$menu.href}" class="{$menu.a_class}"><i class="icon-{$menu.icon}"></i>{$menu.html}</a>
                                    </case>
                                    <case value="search">

                                        <form class="navbar-form navbar-right" action="{:U('Group/Index/search')}" method="{$menu.from_method}" role="search" style="width: 325px;margin: 4px 0;">
                                            <input id="ip_type" type="hidden" name="type" <if condition="$_GET['type'] and $_GET['type'] eq group">value="group"<elseif/>value="post"</if>>
                                            <div class="input-group">
                                                <div class="input-group-btn">
                                                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                            <span id="search_type_title">
                                            <if condition="$_GET['type'] eq 'group'">
                                                {:L('_GROUP_')}
                                                <else/>
                                                {:L('_POST_')}
                                            </if>
                                            </span>
                                                        <span class="caret"></span>
                                                    </button>
                                                    <button type="submit" class="btn btn-default" tabindex="-1"><i class="icon-search" style="font-size: 12px;"></i></button>
                                                    <ul class="dropdown-menu" role="menu">
                                                        <li><a onclick="setTab('post')">{:L('_POST_')}</a></li>
                                                        <li><a onclick="setTab('group')">{:L('_GROUP_')}</a></li>
                                                    </ul>
                                                </div><!-- /btn-group -->
                                                <input type="text" name="{$menu.input_name}" value="{$search_keywords}" class="form-control" placeholder="{$menu.input_title}">
                                                <script>
                                                    function setTab(type){
                                                        $('#ip_type').val(type);
                                                        if(type=="post"){
                                                            $('#search_type_title').html("{:L('_POST_')}");
                                                        }else{
                                                            $('#search_type_title').html("{:L('_GROUP_')}");
                                                        }
                                                    }
                                                </script>
                                            </div>
                                        </form>
                                    </case>
                                    <default/>
                                    <if condition="$menu['children']">
                                        <!--二级菜单-->
                                        <li id="tab_{$menu.tab}" class="dropdown {$menu.class}">
                                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                                <neq name="menu.icon" value=""><i class="icon-{$menu.icon}"></i>
                                                </neq>
                                                {$menu.title} <i class="icon-caret-down"></i>
                                                <ul class="dropdown-menu" role="menu">
                                                    <volist name="menu.children" id="child">
                                                        <li><a href="{$child.href}" class="{$child.class}">
                                                            <neq name="child.icon" value=""><i
                                                                    class="glyphicon glyphicon-{$child.icon}"></i></neq>
                                                            {$child.title}</a></li>
                                                    </volist>

                                                </ul>
                                        </li>
                                        <else/>
                                        <!--一级菜单-->
                                        <li id="tab_{$menu.tab}" class="{$menu.li_class}">
                                            <a href="{$menu.href}" class="{$menu.a_class}">
                                            <neq name="menu.icon" value=""><i class="glyphicon glyphicon-{$menu.icon}"></i>
                                            </neq>
                                            {$menu.title}</a></li>
                                    </if>

                                </switch>



                            </volist>
                        </ul>
                    </if>
                </div>
                <!-- /.navbar-collapse -->
            </div>
        </div>
    </nav>
</div>

<script>
    $('#sub_nav #tab_{$current}').addClass('active');
</script>